#ifndef FTPCLIENTOBJECT_H
#define FTPCLIENTOBJECT_H

#include <QThread>
class QFtp;
class QUrlInfo;
class QIODevice;

class FtpClientThread : public QThread
{
    Q_OBJECT
public:
    explicit FtpClientThread(const QStringList &dcms, const QString &dir, QObject *parent = 0);
    ~FtpClientThread();

    void run() Q_DECL_OVERRIDE;

signals:
    void error(const QString &err);

protected slots:
    void onList(const QUrlInfo &url);
    void onStateChanged(int state);
    void onFtpDone(bool err);
    void onCommandFinished(int id, bool err);

private:
    QFtp *m_ftp;
    QStringList m_dcms;
    QString m_dir;
    QList<QIODevice*> m_devs;
};

#endif // FTPCLIENTOBJECT_H
